#include "url/include/setting_url.h"


std::shared_ptr<Response> N404(std::shared_ptr<RequestHead> args){
    printf("没有找到网页...\n");
    // std::shared_ptr<RequestHead> head=*(std::shared_ptr<RequestHead>*) args;
    std::shared_ptr<Response> resp(new Response(args));
    std::string buf="404";
    resp->setStatus(404);
    resp->setDescribe("ERR");
    resp->setText(buf);
    printf("N404_3\n");
    return resp;
}

std::shared_ptr<Response> index(std::shared_ptr<RequestHead> args){
    printf("index.html\n");
    // RequestHead* head=(RequestHead*)args;
    // std::shared_ptr<RequestHead> head=*(std::shared_ptr<RequestHead>*) args;
    std::shared_ptr<Response> resp(new Response(args));
    // Response* resp=new Response(head);
    std::string buf="hello World!";
    resp->setStatus(200);
    resp->setDescribe("OK");
    resp->setText(buf);
    return resp;
}

void configuration(){
    urls.url("",N404);
    urls.url("/index/",index);
    printf("url 配置完毕\n");
}